If your when expression evaluates to an Int, you can use ranges (.. notation) to take certain branches when the number is in the requested range.

You can learn more about this in:
Run Expand Edit